package example.method;

/**
 * Created by lenovo on 2016/11/4 0004.
 */
public class OverLoading {
    private int height;

    private OverLoading() {
        System.out.println("无参构造函数");
    }

    private OverLoading(int height) {
        this.height = height;
        System.out.println("含参数 height 的构造函数 height "+height);
    }
    //仅仅是返回类型不同，构不成方法重载，必须是方法签名【方法名，参数，参数顺序】的不同
    private void info(){
        System.out.println("height = "+height);
    }
    private void info(String s){
        System.out.println("重载的方法： "+ s);
    }
    public static void main(String[] args){
        OverLoading o = new OverLoading();
        o.info();
        OverLoading o2 = new OverLoading(20);
        o2.info("字符串");
    }
}
